<%--
  Created by IntelliJ IDEA.
  User: Sn
  Date: 2022/9/20
  Time: 15:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>学生修改</h1>
<form action="/stu/edit.action" method="post">
    <input type="hidden" name="id" value="${requestScope.stu.id}">
    <div><span>姓名</span><input type="text" name="name" value="${requestScope.stu.name}"></div>
    <div><span>年龄</span><input type="text" name="age" value="${requestScope.stu.age}"></div>
    <div><span>性别</span>
        <input type="radio"
               <c:if test="${requestScope.stu.sex=='M'}">checked </c:if> name="sex" value="M"><span>男</span>
        <input type="radio"
               <c:if test="${requestScope.stu.sex=='W'}">checked </c:if> name="sex" value="W"><span>女</span>
    </div>
    <div><span>分数</span><input type="text" name="score" value="${requestScope.stu.score}"></div>
    <button type="submit">确认修改</button>
    <button type="button" onclick="back()">返回</button>
</form>

</body>
</html>
<script>
    function back() {
        window.location = "/stu/getAll.action";
    }
</script>
